<%@ page contentType="text/html;charset=UTF-8" language="java"
	isELIgnored="false"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>用户列表</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/materialdesignicons.min.css" rel="stylesheet">
<link href="css/style.min.css" rel="stylesheet">
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="js/main.min.js"></script>



</head>
<body>
	<div class="lyear-layout-web">
  <div class="lyear-layout-container">
    <!--左侧导航-->
    <aside class="lyear-layout-sidebar">
       
      <!-- logo -->
      
      <div class="lyear-layout-sidebar-scroll">
     
        <div class="sidebar-footer">
          <p class="copyright">Copyright &copy; 2020. <a target="_blank" href="https://space.bilibili.com/34620415">xiejiacheng</a> All rights reserved.</p>
        </div>
      </div>
      
    </aside>
    <!--End 左侧导航-->
    <header class="lyear-layout-header">
      
      <nav class="navbar navbar-default">
        <div class="topbar">
          
          <div class="topbar-left">
            <div class="lyear-aside-toggler">
              <span class="lyear-toggler-bar"></span>
              <span class="lyear-toggler-bar"></span>
              <span class="lyear-toggler-bar"></span>
            </div>
            <span class="navbar-page-title"> 文件管理器 </span>
          </div>
          
          <ul class="topbar-right">
            <li class="dropdown dropdown-profile">
              <a href="javascript:void(0)" data-toggle="dropdown">
               
              </a>
              <ul class="dropdown-menu dropdown-menu-right">
               
              </ul>
            </li>
            <!--切换主题配色-->
		    
          </ul>
          
        </div>
      </nav>
      <main class="lyear-layout-content">
      
      <div class="container-fluid">
        
        <div class="row">
          <div class="col-lg-12">
            <div class="card">
              <div class="card-toolbar clearfix">
                <form class="pull-right search-bar" action="${pageContext.request.contextPath }/findByCondition"
			method="post" role="form">
                  <div class="input-group">
                    <div class="input-group-btn">
                      <input type="hidden" name="search_field" id="search-field" value="title">
                      <button class="btn btn-default dropdown-toggle" id="search-btn" data-toggle="dropdown" type="button" aria-haspopup="true" aria-expanded="false">
                       <span class="caret"></span>
                      </button>
                      <ul class="dropdown-menu">
                        <li> <a tabindex="-1" href="javascript:void(0)" data-field="title">文件列表</a> </li>
                      </ul>
                    </div>
                    <input type="text" class="form-control" value="" id="filename" placeholder="请输入文件名称"
					name="filename">
                  </div>
                </form>
                <div class="toolbar-btn-action">
                  <a class="btn btn-primary m-r-5" href="${pageContext.request.contextPath }/edit">新增</a>
                 
                </div>
              </div>
              <div class="card-body">
                
                <div class="table-responsive">
                  <table class="table table-bordered">
                    <thead>
                      <tr>
                        
                        <th>用户名</th>
                        <th>用户文件</th>
                        <th>操作</th>
                      </tr>
                    </thead>
                    <tbody>
                      <tr>
                        <td>
                          
                        </td>
                        <c:forEach items="${pageInfo.list}" var="file">
				<tr>
                       
                        <td>${file.username}</td>
                        <td>${file.filename}</td>
                        <td>
                          <div class="btn-group">
                            <a class="btn btn-xs btn-default" href="${pageContext.request.contextPath }/edit?id=${file.id}" title="编辑" data-toggle="tooltip">编辑</a>
                            <a class="btn btn-xs btn-default" href="${pageContext.request.contextPath }/download?filename=${file.filename}" title="查看" data-toggle="tooltip">下载</i></a>
                            <a class="btn btn-xs btn-default" href="${pageContext.request.contextPath }/del?id=${file.id}" title="删除" data-toggle="tooltip">删除</a>
                          </div>
                        </td>
                      </tr></c:forEach>
                     
                        
                      
                    </tbody>
                  </table>
                </div>
                <ul class="pagination">
                  <c:if test="${pageInfo.hasPreviousPage}">
						<li><a
							href="${pageContext.request.contextPath }/users?pageNum=${pageInfo.pageNum-1}"
							aria-label="Previous"> <span aria-hidden="true">&laquo;</span>
						</a></li>
					</c:if>
					<c:forEach begin="1" end="${pageInfo.pages}" var="i">
						<li><a
							href="${pageContext.request.contextPath }/users?pageNum=${i}">${i}</a></li>
					</c:forEach>
					<c:if test="${pageInfo.hasNextPage}">
						<li><a
							href="${pageContext.request.contextPath }/users?pageNum=${pageInfo.pageNum+1}"
							aria-label="Next"> <span aria-hidden="true">&raquo;</span>
						</a></li>
					</c:if>
                </ul>
       
              </div>
            </div>
          </div>
          
        </div>
        
      </div>
      
    </main>
      
    </header>
	
	<script
		src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
	<script
		src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
		<script type="text/javascript">
$(function(){
    $('.search-bar .dropdown-menu a').click(function() {
        var field = $(this).data('field') || '';
        $('#search-field').val(field);
        $('#search-btn').html($(this).text() + ' <span class="caret"></span>');
    });
});
</body>
</html>


